package com.icw.resource.inner.properties;

import java.util.Map;

import com.icw.basis.PropertySettings;
import com.icw.resource.inner.entity.IcwMenu;
import com.icw.utility.IcwUtils;
import com.icw.utility.query.IcwCriterion;

public class Ps4IcwMenu extends PropertySettings<IcwMenu> {

	@Override
	public String[] nameProperties() {
		return new String[] { "name" };
	}

	@Override
	public String[] keyProperties() {
		return new String[] { "name", "route", "parent.name" };
	}

	@Override
	public String[] listProperties() {
		return new String[] { "name", "route" };
	}

	@Override
	public String[] editProperties() {
		return new String[] { "name", "route", "perms", "parent" };
	}

	@Override
	public String[] addProperties() {
		return new String[] { "name", "route", "perms", "parent" };
	}

	@Override
	public String[] criteriaProperties() {
		return new String[] { "parent" };
	}

	@Override
	public String[] listLabels() {
		return null;
	}

	@Override
	public Integer[] listIndexes() {
		return null;
	}

	@Override
	public String[] editLabels() {
		return null;
	}

	@Override
	public Integer[] editIndexes() {
		return null;
	}

	@Override
	public String[] addLabels() {
		return null;
	}

	@Override
	public Integer[] addIndexes() {
		return null;
	}

	@Override
	public String[] criteriaLabels() {
		return null;
	}

	@Override
	public Integer[] criteriaIndexes() {
		return null;
	}

	@Override
	public void permSettings(Map<String, Map<String, Object>> perm_map) {
		super.permSettings(perm_map);
		perm_map.put("getlist", IcwUtils.mapObject("criteria.criterions[?]", new IcwCriterion("eq", "perms.roles.users.id", "{{user.id}}")));
	}

	@Override
	public void adminSettings(Map<String, Map<String, Object>> admin_map) {
		super.adminSettings(admin_map);
		admin_map.put("getlist", null);
	}
}
